home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
comm2
/
kms20src.lha
/
KMSC
/
commands.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-23
|
75KB
|
2,787 lines
/**********************************
* KMS *
**********************************
* ©1992 by BlackMagic Software *
**********************************
* *
**********************************/
#include <KMS/KMS.h>
Prototype VOID Cmd_QMARK(VOID);
Prototype VOID Cmd_HILFE(VOID);
Prototype VOID Cmd_BRETT(VOID);
Prototype VOID Cmd_INHALT(VOID);
Prototype VOID Cmd_LESEN(VOID);
Prototype VOID Cmd_SCHREIBEN(VOID);
Prototype VOID Cmd_ANTWORT(VOID);
Prototype VOID Cmd_SHUTDOWN(VOID);
Prototype VOID Cmd_UMSINFO(VOID);
Prototype VOID Cmd_HISTORY(VOID);
Prototype VOID Cmd_UMSDIR(VOID);
Prototype VOID Cmd_AEDIT(VOID);
Prototype VOID Cmd_UMSEXPIRE(VOID);
Prototype VOID Cmd_USERPREFS(VOID);
Prototype VOID Cmd_TEMPPREFS(VOID);
Prototype VOID Cmd_PASSWORD(VOID);
Prototype VOID Cmd_DELETE(VOID);
Prototype VOID Cmd_DELPROT(VOID);
Prototype VOID Cmd_SELECT(VOID);
Prototype VOID Cmd_HIDE(VOID);
Prototype VOID Cmd_PORTLIST(VOID);
Prototype VOID Cmd_KMSREXX(UWORD);
Prototype VOID Cmd_KMSBATCH(VOID);
Prototype VOID Cmd_ECHO(VOID);
Prototype VOID Cmd_LABERFILTER(VOID);
Prototype VOID Cmd_VORMERKER(VOID);
Prototype VOID Cmd_UEDIT(VOID);
Prototype VOID Cmd_UDIR(VOID);
Prototype VOID Cmd_PEDIT(VOID);
Prototype VOID Cmd_PDELETE(VOID);
Prototype VOID Cmd_PDIR(VOID);
Prototype VOID Cmd_PUPLOAD(VOID);
Prototype VOID Cmd_PDOWNLOAD(VOID);
Prototype VOID Cmd_SIGEDIT(VOID);
Prototype VOID Cmd_INFO(VOID);
Prototype VOID Cmd_ALIAS(VOID);
Prototype VOID Cmd_LOG(VOID);
Prototype VOID Cmd_ACLEDIT(VOID);
Prototype VOID Cmd_SYSMSG(VOID);
Prototype VOID Cmd_REREAD(VOID);
Prototype VOID Cmd_BITED(VOID);
Prototype VOID Cmd_UPLOAD(VOID);
Prototype VOID Cmd_DOWNLOAD(VOID);
Prototype VOID Cmd_SCHREIBMODUS(VOID);
Prototype VOID Cmd_EXEC(VOID);
Prototype VOID Cmd_PAUSE(VOID);
Prototype VOID Cmd_CHAT(VOID);
/*****************************
* Externe Globale Variablen *
*****************************/
extern struct KMSBase *KMSBase;
extern struct LocalConfig *KMS_LC;
extern UBYTE ShutDown;
extern UBYTE CmdArgC;
extern STRPTR CmdArgV[];
extern UMSAccount MyUMSAccount, SysUMSAccount;
extern UMSMsgNum Lastmsg;
extern STRPTR PPArg, PPArg2;
extern TEXT PathString[LEN_KMSPATH+1];
extern BPTR OldInput;
extern struct UserNode MerkUser;
/*********************
* Globale Variablen *
*********************/
/***************************************
* Befehl: ? *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_QMARK"
VOID Cmd_QMARK(VOID)
{
struct CommandNode *cpoint;
UBYTE result = 0, count = 0;
TEXT cmdname[LEN_COMMAND*2+1];
TEXT output[LEN_PARSEOUT+1];
SysMsg(TITLE_CMDLIST);
cpoint = (struct CommandNode *)KMSBase->CommandList.mlh_Head;
while(cpoint->Node.mln_Succ && !result)
{
if ((cpoint->Level >= 0 && cpoint->Level <= KMS_LC->Session.CurrentUser->UserData.Level)
|| (cpoint->Level < 0 && -cpoint->Level == KMS_LC->Session.CurrentUser->UserData.Level))
{
strcpy(cmdname, cpoint->DisplayName);
StdStringParse(cmdname, output, LEN_PARSEOUT);
if (count == 4)
if (output[strlen(output)-1] == '\t')
output[strlen(output)-1] = '\0';
result = Print(output, PF_CTRLX|PF_NOLF);
count++;
}
if (count == 5)
{
Print(NULL, 0);
count = 0;
}
cpoint = (struct CommandNode *)cpoint->Node.mln_Succ;
}
if (count)
Print(NULL, 0);
Print(NULL, 0);
}
///
/***************************************
* Befehl: HILFE *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_HILFE"
VOID Cmd_HILFE(VOID)
{
TEXT buff[32];
if (CmdArgC == 1)
{
/* "HILFE" -> Allgemeine Hilfe */
SendFile("KMS_HELP_0", SF_CHOOSEEXT);
}
else if (CmdArgC == 2)
{
/* "HILFE befehl" -> Spezielle Hilfe */
UWORD cid = CmdSearch(CmdArgV[1]);
if (cid)
{
sprintf(buff, "KMS_HELP_%d",cid);
SendFile(buff, SF_CHOOSEEXT);
}
else
SysMsg(NO_HELP);
}
else
{
SysMsg(TOO_MANY_PARAMS);
}
}
///
/***************************************
* Befehl: BRETT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_BRETT"
VOID Cmd_BRETT(VOID)
{
UMSMsgNum num;
struct AreaNode *currarea = NULL;
TEXT all[LEN_NUMBER+1];
TEXT new[LEN_NUMBER+1];
if (CmdArgC == 1)
{
/* "BRETT" -> Info aktuelles Brett */
SelectArea(KMS_LC->Session.CurrentArea->AreaData.MBName);
num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_InGroup,
UMSTAG_SelMatch, KMSLSTATF_InGroup,
TAG_DONE);
sprintf(all, "%ld", num);
PPArg = all;
num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_Unread|KMSLSTATF_InGroup,
UMSTAG_SelMatch, KMSLSTATF_Unread|KMSLSTATF_InGroup,
TAG_DONE);
sprintf(new, "%ld", num);
PPArg2 = new;
SysMsg(DIRLST_ACT);
PPArg2 = NULL;
PPArg = NULL;
SysMsg(DIRLST_HEAD);
PrintAreaInfo(KMS_LC->Session.CurrentArea, KMS_LC->Session.CurrentAccess);
}
else if (CmdArgC == 2)
{
/* Parameter 1 auswerten */
if (CmpArg(1, "+!") || CmpArg(1, "#"))
{
/* "BRETT +!" -> Wechsel in nächstes Brett mit neuen Nachrichten */
ReadMsg(0, RF_RESET);
ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTNEW);
}
else if (CmpArg(1, "+"))
{
/* "BRETT +" -> Wechsel in naechstes Brett */
currarea = KMS_LC->Session.CurrentArea;
ReadMsg(0, RF_RESET);
ListAreas(NULL, ALIST_WHOLE|ALIST_NEXT);
if (KMS_LC->Session.CurrentUser->UserData.Flags & UF_AUTO_AREALIST)
if (currarea != KMS_LC->Session.CurrentArea)
ListAreas(NULL, ALIST_ALL);
}
else if (CmpArg(1, "+%") || CmpArg(1, "+@"))
{
/* "BRETT +%" -> Wechsel in nächstes Brett mit selekt. Nachrichten */
ReadMsg(0, RF_RESET);
ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTSEL);
}
else if (CmpArg(1, "!"))
{
/* "BRETT !" -> Bretter mit neuen Nachrichten ab aktuellem */
ListAreas(NULL, ALIST_NEW);
}
else if (CmpArg(1, "*"))
{
/* "BRETT *" -> Alle Bretter ab aktuellem */
ListAreas(NULL, ALIST_ALL);
}
else if (CmpArg(1, "%") || CmpArg(1, "@"))
{
/* "BRETT %" -> Alle Bretter mit selekt. Nachrichten ab aktuellem */
ListAreas(NULL, ALIST_SEL);
}
else if (CmpArg(1, "!!"))
{
/* "BRETT !!" -> Bretter mit neuen ab aktuellem / Alle Ebenen */
ListAreas(NULL, ALIST_NEW|ALIST_WHOLE);
}
else if (CmpArg(1, "**"))
{
/* "BRETT **" -> Alle Bretter ab aktuellem / Alle Ebenen */
ListAreas(NULL, ALIST_ALL|ALIST_WHOLE);
}
else if (CmpArg(1, "%%") || CmpArg(1, "@@"))
{
/* "BRETT %%" -> Bretter mit selektierten ab aktuellem / Alle Ebenen */
ListAreas(NULL, ALIST_SEL|ALIST_WHOLE);
}
else
{
/* "BRETT pfad" -> Brettwechsel gemäß Pfadangabe */
if(!ChangePath(CmdArgV[1]))
SysMsg(INVALID_PATH);
}
}
else if (CmdArgC == 3)
{
/* Parameter 1 und 2 auswerten */
if (CmpArg(2, "+!") || CmpArg(2, "#"))
{
/* "BRETT pfad +!" -> Wechsel in nächstes Brett mit neuen Nachrichten ab pfad */
ReadMsg(0, RF_RESET);
ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXTNEW);
}
else if (CmpArg(2, "+"))
{
/* "BRETT pfad +" -> Wechsel in naechstes Brett ab pfad */
ReadMsg(0, RF_RESET);
ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXT);
}
else if (CmpArg(2, "+%") || CmpArg(2, "+@"))
{
/* "BRETT pfad +%" -> Wechsel in naechstes Brett ab pfad mit selekt. Nachrichten */
ReadMsg(0, RF_RESET);
ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXTSEL);
}
else if (CmpArg(2, "!"))
{
/* "BRETT pfad !" -> Bretter mit neuen Nachrichten ab pfad */
ListAreas(CmdArgV[1], ALIST_NEW);
}
else if (CmpArg(2, "*"))
{
/* "BRETT pfad *" -> Alle Bretter ab pfad */
ListAreas(CmdArgV[1], ALIST_ALL);
}
else if (CmpArg(2, "%") || CmpArg(2, "@"))
{
/* "BRETT pfad %" -> Alle Bretter mit selekt. Nachr. ab pfad */
ListAreas(CmdArgV[1], ALIST_SEL);
}
else if (CmpArg(2, "!!"))
{
/* "BRETT pfad !!" -> Bretter mit neuen ab pfad / Alle Ebenen */
ListAreas(CmdArgV[1], ALIST_NEW|ALIST_WHOLE);
}
else if (CmpArg(2, "**"))
{
/* "BRETT pfad **" -> Alle Bretter ab pfad / Alle Ebenen */
ListAreas(CmdArgV[1], ALIST_ALL|ALIST_WHOLE);
}
else if (CmpArg(2, "%%") || CmpArg(2, "@@"))
{
/* "BRETT pfad %%" -> Alle Bretter mit selekt. Nachr. ab pfad / Alle Ebenen */
ListAreas(CmdArgV[1], ALIST_SEL|ALIST_WHOLE);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: INHALT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_INHALT"
VOID Cmd_INHALT(VOID)
{
if (!(KMS_LC->Session.CurrentAccess & AACC_READ))
{
PPArg = KMS_LC->Session.InputBuffer;
SysMsg(NO_READ_ACCESS);
PPArg = NULL;
return;
}
if (CmdArgC == 1)
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW);
else if (CmdArgC == 2)
{
if (CmpArg(1, ">"))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL|MLIST_CURR);
else if (CmpArg(1, ">!"))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW|MLIST_CURR);
else if (CmpArg(1, "*"))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL);
else if (CmpArg(1, "%") || CmpArg(1, "@"))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_SEL);
else if (CmpArg(1, "P"))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_PROT);
else if (CmpArg(1, "*!"))
{
ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTNEW|ALIST_QUIET))
{
ReadMsg(0, RF_RESET);
MsgPrint("\n", 0);
if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW|MLIST_QUIET))
break;
MsgPrint("\n", 0);
}
KMS_LC->Session.CurrentUser->UserData.Flags = temp;
}
else if (CmpArg(1, "**"))
{
ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXT|ALIST_QUIET))
{
ReadMsg(0, RF_RESET);
MsgPrint("\n", 0);
if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL|MLIST_QUIET))
break;
MsgPrint("\n", 0);
}
KMS_LC->Session.CurrentUser->UserData.Flags = temp;
}
else if (CmpArg(1, "*%") || CmpArg(1, "*@"))
{
ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTSEL|ALIST_QUIET))
{
ReadMsg(0, RF_RESET);
MsgPrint("\n", 0);
if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_SEL|MLIST_QUIET))
break;
MsgPrint("\n", 0);
}
KMS_LC->Session.CurrentUser->UserData.Flags = temp;
}
else if (CmpArg(1, "*P"))
{
ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTPROT|ALIST_QUIET))
{
ReadMsg(0, RF_RESET);
MsgPrint("\n", 0);
if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_PROT|MLIST_QUIET))
break;
MsgPrint("\n", 0);
}
KMS_LC->Session.CurrentUser->UserData.Flags = temp;
}
else if(ParseRange(CmdArgV[1]))
ListMsgs(KMS_LC->Session.CurrentArea, MLIST_RANGE);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: LESEN *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_LESEN"
VOID Cmd_LESEN(VOID)
{
if (!(KMS_LC->Session.CurrentAccess & AACC_READ))
{
PPArg = KMS_LC->Session.InputBuffer;
SysMsg(NO_READ_ACCESS);
PPArg = NULL;
return;
}
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_RMODE_RANGE;
if (CmdArgC == 1)
{
/* "LESEN" -> Nächste neue Nachricht in aktueller Gruppe lesen */
ReadMsg(0, RF_NEW);
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "+"))
ReadMsg(0,RF_NEXT);
else if (CmpArg(1, "-"))
ReadMsg(0,RF_PREV);
else if (CmpArg(1, "["))
ReadMsg(0,RF_FIRST);
else if (CmpArg(1, "]"))
ReadMsg(0,RF_LAST);
else if (CmpArg(1, "="))
ReadMsg(0,RF_SAME);
else if (CmpArg(1, "/"))
ReadMsg(0,RF_NREPLY);
else if (CmpArg(1, "\\"))
ReadMsg(0,RF_PREPLY);
else if (CmpArg(1, "^"))
ReadMsg(0,RF_PARENT);
else if (CmpArg(1, ">"))
ReadMsg(0,RF_RIGHT);
else if (CmpArg(1, "<"))
ReadMsg(0,RF_LEFT);
else if (CmpArg(1, "V"))
ReadMsg(0,RF_DOWN);
else if (CmpArg(1, "!"))
ReadMsg(0,RF_ROOT);
else if (CmpArg(1, "$"))
ReadMsg(0,RF_CONT);
else if (CmpArg(1, "%") || CmpArg(1, "@"))
ReadMsg(0,RF_SEL);
else if (CmpArg(1, "("))
ReadMsg(0,RF_PRVSEL);
else if (CmpArg(1, ")"))
ReadMsg(0,RF_NXTSEL);
else if (CmpArg(1, "&"))
ReadMsg(0,RF_SAME|RF_VERBOSE);
else if (CmpArg(1, "ROT13"))
ReadMsg(0,RF_SAME|RF_ROT13);
else if (ParseRange(CmdArgV[1]))
{
UMSSelectTags(MyUMSAccount,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelUnset, KMSLSTATF_ReadRange,
TAG_DONE);
UMSSelectTags(MyUMSAccount,
UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_InRange,
UMSTAG_SelMatch, KMSLSTATF_InRange,
UMSTAG_SelSet, KMSLSTATF_ReadRange,
TAG_DONE);
ReadMsg(0, RF_RESET);
KMS_LC->Session.CurrentUser->UserData.Flags |= UF_RMODE_RANGE;
ReadMsg(0, RF_RANGE);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: SCHREIBEN *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SCHREIBEN"
VOID Cmd_SCHREIBEN(VOID)
{
if (KMS_LC->Session.CurrentArea->AreaData.Type & ATYPE_FILES)
{
SysMsg(NOT_IN_FILEAREA);
return;
}
if (CmdArgC == 1)
{
/* Neue Nachricht in aktueller Gruppe schreiben */
WriteMsg(WF_NEW, NULL, NULL, NULL);
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "="))
{
/* Nachricht edieren */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
if (WriteMsg(WF_EDIT, NULL, NULL, NULL))
if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
DeleteMsg(NULL, DEL_CURRENT);
}
else if (CmpArg(1, "=="))
{
/* Nachricht nochmal schicken */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
if (WriteMsg(WF_RESEND, NULL, NULL, NULL))
if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
DeleteMsg(NULL, DEL_CURRENT);
}
else if (CmpArg(1, "!"))
{
/* Persoenliche Nachricht von jedem Brett aus */
WriteMsg(WF_NEW|WF_PRIV, NULL, NULL, NULL);
}
else if (CmpArg(1, ">"))
{
/* Weiterleiten in gleichem Brett an evt. anderen Empfänger */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
WriteMsg(WF_FORWARD, KMS_LC->Session.CurrentArea, NULL, NULL);
}
else if (CmpArg(1, "<"))
{
/* Neue Nachricht per Upload */
WriteMsg(WF_NEW, NULL, "", NULL);
}
else if (CmpArg(1, "ROT13"))
{
/* Neue Nachricht in aktueller Gruppe, ROT-13 kodiert */
WriteMsg(WF_NEW|WF_ROT13, NULL, NULL, NULL);
}
else
WriteMsg(WF_NEW, NULL, NULL, CmdArgV[1]);
}
else if (CmdArgC == 3)
{
if (CmpArg(1, ">"))
{
/* Nachricht weiterleiten */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
{
struct AreaNode *group;
if (group=ChangeArea(CmdArgV[2]))
{
CreatePath(group);
PPArg2 = PathString;
if (YNRequest(CROSS_FORWARD, TRUE))
WriteMsg(WF_FORWARD, group, NULL, NULL);
PPArg2 = NULL;
}
else
SysMsg(INVALID_PATH);
}
}
else if (CmpArg(1, "="))
{
/* Nachricht in anderes Brett kopieren/verschieben */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
{
struct AreaNode *group;
if (group=ChangeArea(CmdArgV[2]))
{
CreatePath(group);
PPArg2 = PathString;
if (YNRequest(QUERY_MOVE_MSG, TRUE))
{
PPArg2 = NULL;
if (CloneMsg(Lastmsg, group, FALSE))
if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
DeleteMsg(NULL, DEL_CURRENT);
}
PPArg2 = NULL;
}
else
SysMsg(INVALID_PATH);
}
}
else if (CmpArg(1, "<"))
{
/* Neue Nachricht aus Priv-File in aktuellem Brett */
TEXT dosbuff[LEN_DOSPATH+1];
sprintf(dosbuff, "%s%s/%s",
KMSBase->UserDir,
KMS_LC->Session.CurrentUser->UserData.Name,
CmdArgV[2]);
ConvertSpace(dosbuff);
if (!Exists(dosbuff))
SysMsg(FILE_NOT_FOUND);
else
WriteMsg(WF_NEW, NULL, dosbuff, NULL);
}
else if (CmpArg(1, "!"))
{
WriteMsg(WF_NEW|WF_PRIV, NULL, NULL, CmdArgV[2]);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: ANTWORT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_ANTWORT"
VOID Cmd_ANTWORT(VOID)
{
if (KMS_LC->Session.CurrentArea->AreaData.Type & ATYPE_FILES)
{
SysMsg(NOT_IN_FILEAREA);
return;
}
if (!Lastmsg)
{
SysMsg(NO_MSG_READ);
return;
}
if (CmdArgC == 1)
WriteMsg(WF_REPLY, NULL, NULL, NULL);
else if (CmdArgC == 2)
{
if (CmpArg(1, "!"))
WriteMsg(WF_REPLY|WF_PRIV, NULL, NULL, NULL);
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3)
{
if (CmpArg(1, ">"))
{
struct AreaNode *group;
if (group=ChangeArea(CmdArgV[2]))
{
CreatePath(group);
PPArg2 = PathString;
if (YNRequest(CROSS_REPLY, TRUE))
{
/* Nachricht weiterleiten */
WriteMsg(WF_REPLY, group, NULL, NULL);
}
PPArg2 = NULL;
}
else
SysMsg(INVALID_PATH);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: SHUTDOWN *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SHUTDOWN"
VOID Cmd_SHUTDOWN(VOID)
{
if (!(KMS_LC->Device & DEV_CONSOLE))
{
SysMsg(SHUTDOWN_IMPOSSIBLE);
return;
}
if (CmdArgC == 1) /* Sofortiger lokaler Shutdown */
{
SysMsg(LOCAL_IMM_SHUTDOWN);
WORD timeleft = KMS_LC->Session.MaxConnectTime - (MakeTime(NULL, KMS_LC->Session.LoginTime, 0) / 60);
if (timeleft > 0)
KMS_LC->Session.MaxConnectTime -= timeleft;
ShutDown = SHUTDOWN_IMMEDIATE;
}
else if (CmdArgC == 2)
{
if (atoi(CmdArgV[1]) > 0)
{
TEXT buff[32];
UWORD offset = atoi(CmdArgV[1]);
sprintf(buff, "%d", offset);
PPArg = buff;
SysMsg(GLOBAL_SHUTDOWN);
PPArg = NULL;
WORD timeleft = KMS_LC->Session.MaxConnectTime - (MakeTime(NULL, KMS_LC->Session.LoginTime, 0) / 60);
if (timeleft > offset)
KMS_LC->Session.MaxConnectTime -= (timeleft - offset);
sprintf(buff, "SHUTDOWN DELAY %d", offset);
sendRexxCmd(buff, NULL, NULL, NULL, NULL, "KMS");
ShutDown = SHUTDOWN_DELAYED;
}
else if (CmpArg(1, "!")) /* Sofortiger globaler Shutdown */
{
SysMsg(GLOBAL_IMM_SHUTDOWN);
sendRexxCmd("SHUTDOWN", NULL, NULL, NULL, NULL, "KMS");
}
else if (CmpArg(1, "!!")) /* Sofortiger globaler Shutdown mit QuitUMS */
{
SysMsg(GLOBAL_IMM_SHUTDOWN);
sendRexxCmd("SHUTDOWN UMS", NULL, NULL, NULL, NULL, "KMS");
}
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3) /* Shutdown mit Portangabe */
{
if (CmpArg(1, ">"))
{
if (atoi(CmdArgV[2]) > 0)
{
TEXT target[LEN_NUMBER+4+1];
sprintf(target, "KMS.%d", atoi(CmdArgV[2]));
sendRexxCmd("SHUTDOWN", NULL, NULL, NULL, NULL, target);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: UMSINFO *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_UMSINFO"
VOID Cmd_UMSINFO(VOID)
{
UMSMsgNum msgnum;
TEXT buff[32];
if (CmdArgC == 1)
{
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Archive,
UMSTAG_SelMatch, UMSUSTATF_Archive,
TAG_DONE);
sprintf(buff, "Archive....: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Junk,
UMSTAG_SelMatch, UMSUSTATF_Junk,
TAG_DONE);
sprintf(buff, "Junk.......: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_PostPoned,
UMSTAG_SelMatch, UMSUSTATF_PostPoned,
TAG_DONE);
sprintf(buff, "PostPoned..: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Selected,
UMSTAG_SelMatch, UMSUSTATF_Selected,
TAG_DONE);
sprintf(buff, "Selected...: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Filtered,
UMSTAG_SelMatch, UMSUSTATF_Filtered,
TAG_DONE);
sprintf(buff, "Filtered...: %ld", msgnum);
Print(buff, 0);
Print("-------------------------------------",0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Old,
UMSTAG_SelMatch, UMSUSTATF_Old,
TAG_DONE);
sprintf(buff, "Read.......: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_WriteAccess,
UMSTAG_SelMatch, UMSUSTATF_WriteAccess,
TAG_DONE);
sprintf(buff, "WriteAccess: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_ReadAccess,
UMSTAG_SelMatch, UMSUSTATF_ReadAccess,
TAG_DONE);
sprintf(buff, "ReadAccess.: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_ViewAccess,
UMSTAG_SelMatch, UMSUSTATF_ViewAccess,
TAG_DONE);
sprintf(buff, "ViewAccess.: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_Owner,
UMSTAG_SelMatch, UMSUSTATF_Owner,
TAG_DONE);
sprintf(buff, "Owner......: %ld", msgnum);
Print(buff, 0);
Print("=====================================",0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_Deleted,
UMSTAG_SelMatch, UMSGSTATF_Deleted,
TAG_DONE);
sprintf(buff, "Deleted....: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_Expired,
UMSTAG_SelMatch, UMSGSTATF_Expired,
TAG_DONE);
sprintf(buff, "Expired....: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_Exported,
UMSTAG_SelMatch, UMSGSTATF_Exported,
TAG_DONE);
sprintf(buff, "Exported...: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_Orphan,
UMSTAG_SelMatch, UMSGSTATF_Orphan,
TAG_DONE);
sprintf(buff, "Orphan.....: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_Link,
UMSTAG_SelMatch, UMSGSTATF_Link,
TAG_DONE);
sprintf(buff, "Link.......: %ld", msgnum);
Print(buff, 0);
msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
UMSTAG_SelMask, UMSGSTATF_HardLink,
UMSTAG_SelMatch, UMSGSTATF_HardLink,
TAG_DONE);
sprintf(buff, "HardLink...: %ld", msgnum);
Print(buff, 0);
}
else if (CmdArgC == 2)
{
if (atol(CmdArgV[1]))
MsgStatusInfo(atol(CmdArgV[1]));
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: HISTORY *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_HISTORY"
VOID Cmd_HISTORY(VOID)
{
if (CmdArgC == 1)
{
struct HistoryNode *hpoint = KMS_LC->Session.HistPoint;
while(hpoint->Node.mln_Pred)
{
Print(hpoint->Cmd,0);
hpoint = hpoint->Node.mln_Pred;
}
}
else
{
SysMsg(TOO_MANY_PARAMS);
}
}
///
/***************************************
* Befehl: UMSDIR *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_UMSDIR"
VOID Cmd_UMSDIR(VOID)
{
UMSMsgNum msgnum = 0, num = 0;
STRPTR areaname;
BOOL invers = FALSE;
TEXT buff[LEN_NUMBER+3+1];
if (CmdArgC > 2)
{
SysMsg(TOO_MANY_PARAMS);
return;
}
else if (CmdArgC > 1)
{
if (CmpArg(1, "!")) /* Nicht registrierte Areas ausgeben */
invers = TRUE;
else
{
SysMsg(INVALID_PARAMS);
return;
}
}
/* Alle gesetzten Local-Flag 8 rücksetzen */
UMSSelectTags(MyUMSAccount, UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelUnset, KMSLSTATF_Temp2,
TAG_DONE);
UMSSelectTags(MyUMSAccount, UMSTAG_SelMask, UMSUSTATF_ViewAccess,
UMSTAG_SelMatch, 0,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_Temp2,
TAG_DONE);
/* Solange weitere Nachricht mit nicht gesetztem Local-Flag 8 */
while(msgnum = UMSSearchTags(MyUMSAccount, UMSTAG_SearchLast, msgnum,
UMSTAG_SearchDirection, 1,
UMSTAG_SearchLocal, TRUE,
UMSTAG_SearchMask, KMSLSTATF_Temp2,
UMSTAG_SearchMatch, 0,
TAG_DONE))
{
/* Gruppennamen besorgen */
if (ReadUMSMsgTags(MyUMSAccount, UMSTAG_RMsgNum, msgnum,
UMSTAG_RGroup, &areaname,
TAG_DONE))
{
/* In allen Nachrichten der Gruppe Local-Flag 8 setzen */
num = UMSSelectTags(MyUMSAccount, UMSTAG_WGroup, (STRPTR)areaname ? (STRPTR)areaname : (STRPTR)"",
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_Temp2,
UMSTAG_SelQuick, TRUE,
TAG_DONE);
/* Wenn Echomail-Gruppe */
if (areaname)
{
/* Gefundene Area ausgeben */
if (!invers || !AreaSearch(areaname))
{
Print(areaname, PF_NOLF|PF_NOBRK);
sprintf(buff, " (%ld)", num);
Print(buff, 0);
}
}
}
/* Message freigeben */
FreeUMSMsg(MyUMSAccount, msgnum);
}
}
///
/***************************************
* Befehl: AEDIT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_AEDIT"
VOID Cmd_AEDIT(VOID)
{
if (FindPort("KMSAM"))
{
SysMsg(DATA_BEING_PROCESSED);
return;
}
if (CmdArgC == 1)
{
/* Aktuelle Area editieren */
EditArea(NULL, AED_OLD);
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "*"))
{
/* Multiples Area-Edit */
AreaModify(NULL, 0);
}
else if (CmpArg(1, "**"))
{
/* Multiples Area-Edit */
AreaModify(NULL, ALIST_WHOLE);
}
else
{
/* Angegebene Area edieren */
EditArea(CmdArgV[1], AED_OLD);
}
}
else if (CmdArgC == 3)
{
if (CmpArg(1, "+"))
/* Brett-Neuanlage */
EditArea(CmdArgV[2], AED_NEW);
else if (CmpArg(1, "-"))
/* Brett löschen */
RemoveArea(CmdArgV[2]);
else if (CmpArg(2, "*"))
/* Multiples Area-Edit mit Pfadangabe */
AreaModify(CmdArgV[1], 0);
else if (CmpArg(2, "**"))
/* Multiples Area-Edit mit Pfadangabe global */
AreaModify(CmdArgV[1], ALIST_WHOLE);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: UMSEXPIRE *
***************************************
* I: .-- *
* O: --- *
***************************************/
/// "Cmd_UMSEXPIRE"
VOID Cmd_UMSEXPIRE(VOID)
{
if (CmdArgC > 3)
SysMsg(TOO_MANY_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "!")) /* Mit Reset */
WaitsyncRexxCmd("EXPIRE RESET", "KMS");
else if (CmpArg(1, "#")) /* Auch alle nicht registrierten Groups */
WaitsyncRexxCmd("EXPIRE UNLISTED", "KMS");
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3)
{
if ((CmpArg(1, "!") && CmpArg(2, "#")) || (CmpArg(1, "#") && CmpArg(2, "!"))) /* Mit Reset, alle nicht reg. Gr. */
WaitsyncRexxCmd("EXPIRE RESET UNLISTED", "KMS");
else
SysMsg(INVALID_PARAMS);
}
else
WaitsyncRexxCmd("EXPIRE", "KMS");
}
///
/***************************************
* Befehl: USERPREFS *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_USERPREFS"
VOID Cmd_USERPREFS(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
EditUserInfo(KMS_LC->Session.CurrentUser, EU_PREFS);
}
///
/***************************************
* Befehl: TEMPPREFS *
***************************************
* I: --- *
* O: --- *
***************************************/
/// Cmd_TEMPPREFS
VOID Cmd_TEMPPREFS(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
{
if(!(KMS_LC->Session.CurrentUser->UserData.Flags & UF_DO_NOT_SAVE))
MerkUser.UserData = KMS_LC->Session.CurrentUser->UserData;
EditUserInfo(KMS_LC->Session.CurrentUser, EU_PREFS);
KMS_LC->Session.CurrentUser->UserData.Flags |= UF_DO_NOT_SAVE;
}
}
///
/***************************************
* Befehl: PASSWORD *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PASSWORD"
VOID Cmd_PASSWORD(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
EditUserInfo(KMS_LC->Session.CurrentUser, EU_PWD);
}
///
/***************************************
* Befehl: DELETE *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_DELETE"
VOID Cmd_DELETE(VOID)
{
if (CmdArgC == 1)
{
/* Aktuelle Nachricht löschen */
DeleteMsg(NULL, DEL_CURRENT);
}
else if (CmdArgC == 2)
{
if (ParseRange(CmdArgV[1]))
{
/* Nachricht Nr. x löschen */
DeleteMsg(NULL, DEL_RANGE);
}
else if (CmpArg(1, "%") || CmpArg(1, "@"))
{
/* Alle selektierten Nachrichten in aktueller Gruppe löschen */
DeleteMsg(NULL, DEL_SELECTED);
}
else if (CmpArg(1, "*"))
{
/* Alle Nachrichten in aktueller Gruppe löschen */
DeleteMsg(NULL, DEL_ALL);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: DELPROT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_DELPROT"
VOID Cmd_DELPROT(VOID)
{
TEXT buff[LEN_NUMBER+1];
if (CmdArgC == 1)
{
/* Aktuelle Nachricht schuetzen */
DelProtMsg(PROT_CURRENT, TRUE);
}
else if (CmdArgC == 2)
{
/* "DELPROT bereich|+|-|%|?" */
if (ParseRange(CmdArgV[1]))
DelProtMsg(PROT_RANGE, TRUE);
else if (CmpArg(1, "+"))
DelProtMsg(PROT_CURRENT, TRUE);
else if (CmpArg(1, "-"))
DelProtMsg(PROT_CURRENT, FALSE);
else if (CmpArg(1, "%") || CmpArg(1, "@"))
DelProtMsg(PROT_SELECTED, TRUE);
else if (CmpArg(1, "?"))
{
UMSMsgNum msg;
msg = UMSSelectTags(SysUMSAccount, UMSTAG_SelMask, UMSUSTATF_Archive,
UMSTAG_SelMatch, UMSUSTATF_Archive,
TAG_DONE);
sprintf(buff, "%ld", msg);
PPArg = buff;
SysMsg(MSGS_PROTECTED);
PPArg = NULL;
}
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3)
{
if (CmpArg(1, "%") || CmpArg(1, "@"))
{
/* "DELPROT % +|-": Alle selektierten Msgs (ent-)schuetzen */
if (CmpArg(2, "+"))
DelProtMsg(PROT_SELECTED, TRUE);
else if (CmpArg(2, "-"))
DelProtMsg(PROT_SELECTED, FALSE);
}
else if (ParseRange(CmdArgV[1]))
{
/* "DELPROT bereich +|-": Nachricht Nr. x (ent-)schuetzen */
if (CmpArg(2, "+"))
DelProtMsg(PROT_RANGE, TRUE);
else if (CmpArg(2, "-"))
DelProtMsg(PROT_RANGE, FALSE);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: SELECT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SELECT"
VOID Cmd_SELECT(VOID)
{
if (CmdArgC == 1)
{
/* Aktuelle Msg selektieren */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
MsgSelect(MS_CURRENT, NULL);
}
else if (CmdArgC > 1)
{
UBYTE n = 1;
if (!CmpArg(1, "+") && !CmpArg(1, "?") && !CmpArg(1, "-"))
MsgSelect(MS_RESET|MS_QUIET, NULL);
else if (CmpArg(1, "+"))
n++;
for(; n < CmdArgC; n++)
{
if (ParseRange(CmdArgV[n]))
MsgSelect(MS_NUM, NULL); /* Bestimmte Nummern */
else if (CmpArg(n, "?"))
MsgSelect(MS_RESULT, NULL); /* Anzahl selektierter */
else if (CmpArg(n, "!"))
MsgSelect(MS_NEW, NULL); /* Alle alten deselektieren */
else if (CmpArg(n, "#"))
MsgSelect(MS_AREA, NULL); /* Nur Nachr. im aktuellen Brett! */
else if (CmpArg(n, "<"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_FROM, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "<<"))
MsgSelect(MS_FROM, KMS_LC->Session.CurrentUser->UserData.RealName);
else if (CmpArg(n, "&<"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_AND|MS_FROM, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "&<<"))
MsgSelect(MS_AND|MS_FROM, KMS_LC->Session.CurrentUser->UserData.RealName);
else if (CmpArg(n, ">"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_TO, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, ">>"))
MsgSelect(MS_TO, KMS_LC->Session.CurrentUser->UserData.RealName);
else if (CmpArg(n, "&>"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_AND|MS_TO, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "&>>"))
MsgSelect(MS_AND|MS_TO, KMS_LC->Session.CurrentUser->UserData.RealName);
else if (CmpArg(n, "="))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_SUBJECT, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "&="))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_AND|MS_SUBJECT, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "%"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_UMSGROUP, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "&%"))
{
n++;
if (n < CmdArgC)
MsgSelect(MS_AND|MS_UMSGROUP, CmdArgV[n]);
else
SysMsg(TOO_FEW_PARAMS);
}
else if (CmpArg(n, "$"))
MsgSelect(MS_DEFAULT, NULL); /* Antworten auf eigene */
else if (CmpArg(n, "&$"))
MsgSelect(MS_AND|MS_DEFAULT, NULL); /* Antworten auf eigene */
else if (CmpArg(n, "-")) /* Einzelne deselektieren */
{
n++;
if (n < CmdArgC)
{
if (ParseRange(CmdArgV[n]))
MsgSelect(MS_DESELECT|MS_NUM, NULL);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_FEW_PARAMS);
}
else
{
n = CmdArgC;
SysMsg(INVALID_PARAMS);
}
}
}
}
///
/***************************************
* Befehl: HIDE *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_HIDE"
VOID Cmd_HIDE(VOID)
{
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "%") || CmpArg(1, "@"))
MarkRead(MR_SELECTED, NULL);
else if (CmpArg(1, "/") || CmpArg(1, "="))
MarkRead(MR_THREAD|MR_CURRENT, NULL);
else if (CmpArg(1, "<"))
MarkRead(MR_FROM|MR_CURRENT, NULL);
else if (CmpArg(1, "*"))
MarkRead(MR_ALL, NULL);
else if (ParseRange(CmdArgV[1]))
MarkRead(MR_RANGE, NULL);
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3)
{
if (CmpArg(1, "/") || CmpArg(1, "="))
MarkRead(MR_THREAD, CmdArgV[2]);
else if (CmpArg(1, "<"))
MarkRead(MR_FROM, CmdArgV[2]);
else if (CmpArg(2, "*"))
{
if (CmpArg(1, "%") || CmpArg(1, "@"))
MarkRead(MR_SELECTED|MR_GLOBAL, NULL);
if (CmpArg(1, "/") || CmpArg(1, "="))
MarkRead(MR_THREAD|MR_GLOBAL|MR_CURRENT, NULL);
else if (CmpArg(1, "<"))
MarkRead(MR_FROM|MR_GLOBAL|MR_CURRENT, NULL);
else if (CmpArg(1, "*"))
MarkRead(MR_ALL|MR_GLOBAL, NULL);
else if (ParseRange(CmdArgV[1]))
MsgSelect(MR_RANGE|MR_GLOBAL, NULL);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 4)
{
if (CmpArg(3, "*"))
{
if (CmpArg(1, "<"))
MarkRead(MR_FROM|MR_GLOBAL, CmdArgV[2]);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: PORTLIST *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PORTLIST"
VOID Cmd_PORTLIST(VOID)
{
struct KMSNode *member = KMSBase->MemberList.mlh_Head;
TEXT status[8];
TEXT timebuff[18];
TEXT linespeed[LEN_NUMBER+1];
TEXT lvlbuff[4];
TEXT buff[80];
SysMsg(PORTLST_HEAD);
TakeMSem(FALSE);
while(member->Node.mln_Succ)
{
if (*(member->LCPtr->Session.CurrentUser->UserData.Name))
{
MakeTime(buff, 0, member->LCPtr->Session.LoginTime);
strcpy(timebuff, buff+9);
}
else
strcpy(timebuff, "--------");
if (member->LCPtr->Session.LineSpeed)
sprintf(linespeed, "%ld", member->LCPtr->Session.LineSpeed);
else
strcpy(linespeed, "--?--");
sprintf(lvlbuff, "%3d", member->LCPtr->Session.CurrentUser->UserData.Level);
if (member->LCPtr->Session.LineSpeed)
strcpy(status, "Online ");
else if (*(member->LCPtr->Session.CurrentUser->UserData.Name))
{
strcpy(status, "Local");
strcpy(linespeed, "-----");
}
else if (member->LCPtr->Locked)
strcpy(status, "Locked ");
else
{
strcpy(status, "Waiting");
strcpy(timebuff, "");
strcpy(linespeed, "");
strcpy(lvlbuff, "");
}
if (member->LCPtr->Session.CurrentUser->UserData.Flags & UF_PDAT_SECRET)
sprintf(buff, "%2d %-7s %-10.10s %-15.15s %-3.3s %-8.8s %-5.5s %s", member->LCPtr->ID, status, member->LCPtr->Session.CurrentUser->UserData.Name, "", "", "", linespeed, "");
else
sprintf(buff, "%2d %-7s %-10.10s %-15.15s %-3.3s %-8.8s %-5.5s %s", member->LCPtr->ID, status, member->LCPtr->Session.CurrentUser->UserData.Name, member->LCPtr->Session.CurrentUser->UserData.City, lvlbuff, timebuff, linespeed, member->LCPtr->Session.CurrCmd);
Print(buff, 0);
member = member->Node.mln_Succ;
}
DropMSem();
}
///
/***************************************
* Befehl: KMSREXX *
***************************************
* I: Kommandonummer *
* O: --- *
***************************************/
/// "Cmd_KMSREXX"
VOID Cmd_KMSREXX(UWORD cmdnum)
{
TEXT buff[LEN_CMDINPUT+1];
struct CommandNode *cpoint = KMSBase->CommandList.mlh_Head;
/* Gegebenes Kommando als ARexx-Skript auszuführen versuchen */
/* Zunächst vollständigen Kommandonamen besorgen */
while(cpoint->Node.mln_Succ && cpoint->ID != cmdnum)
cpoint = cpoint->Node.mln_Succ;
/* Jetzt Aufruf-String aufbauen */
strcpy(buff, KMSBase->RexxDir);
strcat(buff, cpoint->Name);
strcat(buff, " ");
UBYTE n;
for(n = 1; n < CmdArgC; n++)
{
if (strlen(buff) + strlen(CmdArgV[n]) + 1 <= LEN_CMDINPUT)
{
strcat(buff, CmdArgV[n]);
strcat(buff, " ");
}
}
buff[strlen(buff) - 1] = '\0';
/* Rexx-Aufruf */
if (!ExecKMSRexx(buff))
SystemError("Cmd_KMSREXX", "KMS-Rexx-script not found");
}
///
/***************************************
* Befehl: KMSBATCH *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_KMSBATCH"
VOID Cmd_KMSBATCH(VOID)
{
TEXT dosbuff[LEN_DOSPATH+1];
if (CmdArgC < 2)
SysMsg(TOO_FEW_PARAMS);
else
{
/* Gegebenes Kommando als KMS-Batchdatei auszuführen versuchen */
strncpy(dosbuff, CmdArgV[1], LEN_DOSPATH-4);
dosbuff[LEN_DOSPATH-4] = '\0';
strcat(dosbuff, ".COM");
if (!Batch(dosbuff, BATCH_USER))
SysMsg(BATCH_NOT_FOUND);
}
}
///
/***************************************
* Befehl: ECHO *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_ECHO"
VOID Cmd_ECHO(VOID)
{
if (CmdArgC > 3)
{
SysMsg(TOO_MANY_PARAMS);
}
else if (CmdArgC == 1)
{
if (KMS_LC->Session.Echo)
SysMsg(ECHO_ON);
else
{
KMS_LC->Session.Echo = TRUE;
SysMsg(ECHO_OFF);
KMS_LC->Session.Echo = FALSE;
}
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "+"))
{
KMS_LC->Session.Echo = TRUE;
SysMsg(ECHO_ON);
}
else if (CmpArg(1, "+!"))
{
KMS_LC->Session.Echo = TRUE;
}
else if (CmpArg(1, "-"))
{
KMS_LC->Session.Echo = TRUE;
SysMsg(ECHO_OFF);
KMS_LC->Session.Echo = FALSE;
}
else if (CmpArg(1, "-!"))
{
KMS_LC->Session.Echo = FALSE;
}
else
{
BOOL crsmerk;
if (crsmerk = KMS_LC->Cursor)
CursorOff();
ParsePrint(CmdArgV[1], 0);
if (crsmerk)
CursorOn();
}
}
else if (CmdArgC == 3)
{
if (CmpArg(2, "|") || CmpArg(2, "NOLINE")) /* wg. REXX */
{
BOOL crsmerk;
if (crsmerk = KMS_LC->Cursor)
CursorOff();
ParsePrint(CmdArgV[1], PF_NOLF|PF_NOBRK);
if (crsmerk)
CursorOn();
}
else
SysMsg(INVALID_PARAMS);
}
}
///
/***************************************
* Befehl: LABERFILTER *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_LABERFILTER"
VOID Cmd_LABERFILTER(VOID)
{
if (CmdArgC == 1)
{
/* Laberfilter-Datei defaultmäßig bearbeiten */
ExecKillFile();
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "?")) /* Listeneinträge anzeigen */
ListKillFile();
else if (CmpArg(1, "+")) /* Listeneintrage hinzufügen */
AddKillEntry(0);
else if (CmpArg(1, "-")) /* Listeneintrag löschen */
{
if (ListKillFile())
DelKillEntry();
}
else if (CmpArg(1, "+=")) /* Aktuellen Betreff aufnehmen */
AddKillEntry(HKF_CURRSUBJ);
else if (CmpArg(1, "+<")) /* Aktuellen Autor aufnehmen */
AddKillEntry(HKF_CURRFROM);
else if (CmpArg(1, "+*")) /* Aktuellen Autor global aufnehmen */
AddKillEntry(HKF_CURRFROM|HKF_GLOBAL);
else if (CmpArg(1, "+#")) /* Aktuelle Area aufnehmen */
AddKillEntry(HKF_CURRAREA);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: VORMERKER *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_VORMERKER"
VOID Cmd_VORMERKER(VOID)
{
if (CmdArgC == 1)
{
/* Auto-Select-Datei defaultmäßig bearbeiten */
ExecSelFile(HSF_NEWS);
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "*")) /* Auch alte selektieren */
ExecSelFile(0);
else if (CmpArg(1, "?")) /* Listeneinträge anzeigen */
ListSelFile();
else if (CmpArg(1, "+")) /* Listeneintrage hinzufügen */
AddSelEntry(0);
else if (CmpArg(1, "-")) /* Listeneintrag löschen */
{
if (ListSelFile())
DelSelEntry();
}
else if (CmpArg(1, "+=")) /* Aktuellen Betreff aufnehmen */
AddSelEntry(HSF_CURRSUBJ);
else if (CmpArg(1, "+<")) /* Aktuellen Autor aufnehmen */
AddSelEntry(HSF_CURRFROM);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: UEDIT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_UEDIT"
VOID Cmd_UEDIT(VOID)
{
if (FindPort("KMSUM"))
{
SysMsg(DATA_BEING_PROCESSED);
return;
}
if (CmdArgC == 1)
{
/* Aktuellen User editieren */
EditUser(NULL);
}
else if (CmdArgC == 2)
{
if (CmpArg(1, "?"))
ListUsers(NULL);
else if (CmpArg(1, "*"))
GlobalUserEdit();
else
{
/* Angegebenen User edieren */
if (UserCheck(CmdArgV[1]))
EditUser(CmdArgV[1]);
else
SysMsg(USER_NOT_FOUND);
}
}
else if (CmdArgC == 3)
{
if (CmpArg(1, "+"))
{
/* Angegebenen User neu anlegen */
if (UserCheck(CmdArgV[2]))
SysMsg(USER_ALREADY_EXISTS);
else
EditUser(CmdArgV[2]);
}
else if (CmpArg(1, "-"))
RemoveUser(CmdArgV[2]);
else if (CmpArg(1, "?"))
ListUsers(CmdArgV[2]);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: UDIR *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_UDIR"
VOID Cmd_UDIR(VOID)
{
if (CmdArgC == 1)
{
/* Alle User listen */
ListUsers(NULL);
}
else if (CmdArgC == 2)
{
/* Angegebenen User listen */
ListUsers(CmdArgV[1]);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: PEDIT (Files in UserDir) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PEDIT"
VOID Cmd_PEDIT(VOID)
{
if (CmdArgC < 2)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC > 2)
SysMsg(TOO_MANY_PARAMS);
else
{
if (KMS_LC->Session.CurrentUser->UserData.Level < 255 && (strchr(CmdArgV[1], '/') || strchr(CmdArgV[1], ':') || strstr(CmdArgV[1], ".KMS")))
SysMsg(INVALID_PARAMS);
else
BatchEdit(CmdArgV[1]);
}
}
///
/***************************************
* Befehl: PDELETE (Files in UserDir) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PDELETE"
VOID Cmd_PDELETE(VOID)
{
if (CmdArgC < 2)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC > 2)
SysMsg(TOO_MANY_PARAMS);
else
{
if (strchr(CmdArgV[1], '/') || strchr(CmdArgV[1], ':') || strstr(CmdArgV[1], ".KMS"))
SysMsg(INVALID_PARAMS);
else if (BatchDelete(CmdArgV[1]))
SysMsg(PFILE_DELETED);
else
SysMsg(FILE_NOT_FOUND);
}
}
///
/***************************************
* Befehl: PDIR (Files in UserDir) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PDIR"
VOID Cmd_PDIR(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
BatchDir();
}
///
/***************************************
* Befehl: PUPLOAD (Files > UserDir) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PUPLOAD"
VOID Cmd_PUPLOAD(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
BatchUpload();
}
///
/***************************************
* Befehl: PDOWNLOAD (UserDir) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PDOWNLOAD"
VOID Cmd_PDOWNLOAD(VOID)
{
if (CmdArgC < 2)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC > 2)
SysMsg(TOO_MANY_PARAMS);
else
Download(0, DOWN_XFER|DOWN_PRIVATE, CmdArgV[1]);
}
///
/***************************************
* Befehl: SIGEDIT (Signature) *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SIGEDIT"
VOID Cmd_SIGEDIT(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
BatchEdit("SIGNATURE.KMS");
}
///
/***************************************
* Befehl: INFO *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_INFO"
extern STRPTR KMSTitle;
VOID Cmd_INFO(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
{
Print(KMSTitle, PF_NOLF|PF_NOBRK);
Print(" * Karfunkel Mailbox System * (c)1993-95 Thomas Schwarz", PF_NOBRK);
Print(NULL, PF_NOBRK);
SysMsg(USER_INFO);
}
}
///
/***************************************
* Befehl: ALIAS *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_ALIAS"
VOID Cmd_ALIAS(VOID)
{
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "?")) /* Listeneinträge anzeigen */
ListAliasFile();
else if (CmpArg(1, "+")) /* Listeneintrag hinzufügen */
AddAliasEntry(0);
else if (CmpArg(1, "-")) /* Listeneintrag löschen */
{
if (ListAliasFile())
DelAliasEntry();
}
else if (CmpArg(1, "+=")) /* Aktuellen Autor/Adresse aufnehmen */
AddAliasEntry(GA_CURRENT);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: LOG *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_LOG"
VOID Cmd_LOG(VOID)
{
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "+"))
{
KMS_LC->OutputLog = TRUE;
SysMsg(LOG_ENABLED);
}
else if (CmpArg(1, "-"))
{
KMS_LC->OutputLog = FALSE;
SysMsg(LOG_DISABLED);
}
else if (CmpArg(1, "?"))
{
if (KMS_LC->OutputLog)
SysMsg(LOG_ENABLED);
else
SysMsg(LOG_DISABLED);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: ACLEDIT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_ACLEDIT"
VOID Cmd_ACLEDIT(VOID)
{
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "?"))
ListACL();
else
EditACL(CmdArgV[1]);
}
else if (CmdArgC == 3)
{
if (CmpArg(1, "+"))
EditACL(CmdArgV[2]);
else if (CmpArg(1, "-"))
DeleteACL(CmdArgV[2]);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: SYSMSG *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SYSMSG"
VOID Cmd_SYSMSG(VOID)
{
TEXT buff[LEN_CMDINPUT*2];
if (CmdArgC < 2)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "+"))
{
KMS_LC->Session.CommMode &= ~CM_LOCKED;
SysMsg(COMMS_ENABLED);
}
else if (CmpArg(1, "-"))
{
KMS_LC->Session.CommMode |= CM_LOCKED;
SysMsg(COMMS_DISABLED);
}
else
SysMsg(INVALID_PARAMS);
}
else
{
STRPTR point;
BOOL urgent;
if (CmpArg(1, "!"))
{
urgent = TRUE;
point = strstr(KMS_LC->Session.InputBuffer, CmdArgV[2]);
sprintf(buff, "OUT NOPARSE TEXT \r\07%s: %s", KMS_LC->Session.CurrentUser->UserData.Name, point + strlen(CmdArgV[2]) + 1);
}
else
{
urgent = FALSE;
point = strstr(KMS_LC->Session.InputBuffer, CmdArgV[1]);
sprintf(buff, "OUT NOPARSE TEXT \r%s: %s", KMS_LC->Session.CurrentUser->UserData.Name, point + strlen(CmdArgV[1]) + 1);
}
if (!urgent && CmpArg(1, "*"))
{
if (SendPortMsg(buff, -1, CM_NORMAL))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
else if (!urgent && atoi(CmdArgV[1]))
{
if (SendPortMsg(buff, atoi(CmdArgV[1]), CM_NORMAL))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
else if (!urgent)
{
struct UserNode *upoint;
if (upoint = UserCheck(CmdArgV[1]))
{
TakeMSem(FALSE);
struct KMSNode *member = KMSBase->MemberList.mlh_Head;
while(member->Node.mln_Succ)
{
if (member->LCPtr->Session.CurrentUser == upoint)
{
if (SendPortMsg(buff, member->LCPtr->ID, CM_NORMAL))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
member = member->Node.mln_Succ;
}
DropMSem();
}
else
SysMsg(USER_NOT_FOUND);
}
else if (CmpArg(2, "*"))
{
if (SendPortMsg(buff, -1, CM_URGENT))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
else if (atoi(CmdArgV[2]))
{
if (SendPortMsg(buff, atoi(CmdArgV[2]), CM_URGENT))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
else
{
struct UserNode *upoint;
if (upoint = UserCheck(CmdArgV[2]))
{
TakeMSem(FALSE);
struct KMSNode *member = KMSBase->MemberList.mlh_Head;
while(member->Node.mln_Succ)
{
if (member->LCPtr->Session.CurrentUser == upoint)
{
if (SendPortMsg(buff, member->LCPtr->ID, CM_URGENT))
SysMsg(PORTMSG_SENT);
else
SysMsg(PORTMSG_FAILED);
}
member = member->Node.mln_Succ;
}
DropMSem();
}
else
SysMsg(USER_NOT_FOUND);
}
}
}
///
/***************************************
* Befehl: REREAD *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_REREAD"
VOID Cmd_REREAD(VOID)
{
UMSMsgNum num;
TEXT buff[LEN_NUMBER+1];
if (CmdArgC == 1)
{
/* Aktuelle Msg wiedervorlegen */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
{
if (UMSSelectTags(MyUMSAccount, UMSTAG_SelMsg, Lastmsg,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_PostPoned,
TAG_DONE))
{
strcpy(buff, "1");
PPArg = buff;
SysMsg(MSG_REREAD);
PPArg = NULL;
}
else
SysMsg(MSG_NOT_FOUND);
}
}
else if (CmdArgC > 1)
{
/* Angegebenen Nummernbereich wiedervorlegen */
if (ParseRange(CmdArgV[1]))
{
if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_InRange,
UMSTAG_SelMatch, KMSLSTATF_InRange,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_PostPoned,
TAG_DONE))
{
sprintf(buff, "%ld", num);
PPArg = buff;
SysMsg(MSG_REREAD);
PPArg = NULL;
}
else
SysMsg(MSG_NOT_FOUND);
}
else if (CmpArg(1, "*"))
{
if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_InGroup|KMSLSTATF_Unread,
UMSTAG_SelMatch, KMSLSTATF_InGroup,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_PostPoned,
TAG_DONE))
{
sprintf(buff, "%ld", num);
PPArg = buff;
SysMsg(MSG_REREAD);
PPArg = NULL;
}
else
SysMsg(NO_MSG_FOUND);
}
else if (CmpArg(1, "**"))
{
if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
UMSTAG_SelMask, KMSLSTATF_Visible|KMSLSTATF_Unread,
UMSTAG_SelMatch, KMSLSTATF_Visible,
UMSTAG_SelWriteLocal, TRUE,
UMSTAG_SelSet, KMSLSTATF_PostPoned,
TAG_DONE))
{
sprintf(buff, "%ld", num);
PPArg = buff;
SysMsg(MSG_REREAD);
PPArg = NULL;
}
else
SysMsg(NO_MSG_FOUND);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: BITED *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_BITED"
VOID Cmd_BITED(VOID)
{
if (CmdArgC == 1)
EditBitNames();
else if (CmdArgC == 2)
{
if (CmpArg(1, "?"))
ListBitNames();
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: UPLOAD *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_UPLOAD"
VOID Cmd_UPLOAD(VOID)
{
if (CmdArgC == 1)
Upload(0);
else if (CmdArgC == 2)
SysMsg(INVALID_PARAMS);
else if (CmdArgC == 3)
{
if (CmpArg(1, ">"))
{
/* Binärdatei umsetzen in anderes Brett */
if (!Lastmsg)
SysMsg(NO_MSG_READ);
else
{
struct AreaNode *group;
if (group=ChangeArea(CmdArgV[2]))
{
CreatePath(group);
PPArg2 = PathString;
if (YNRequest(QUERY_MOVE_BINARY, TRUE))
{
PPArg2 = NULL;
if (MoveBin(Lastmsg, group, FALSE))
DeleteMsg(NULL, DEL_CURRENT);
}
PPArg2 = NULL;
}
else
SysMsg(INVALID_PATH);
}
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: DOWNLOAD *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_DOWNLOAD"
VOID Cmd_DOWNLOAD(VOID)
{
if (CmdArgC == 1) /* Aktuelle downloaden */
Download(0, DOWN_XFER|DOWN_CURRENT, NULL);
else if (CmdArgC == 2)
{
if (CmpArg(1, "?")) /* Liste aller selektierten */
Download(0, DOWN_LIST|DOWN_SELECTED, NULL);
else if (CmpArg(1, "&")) /* Aktuelle selektieren für Download */
Download(0, DOWN_SELECT|DOWN_CURRENT, NULL);
else if (CmpArg(1, "-")) /* Aktuelle deselektieren */
Download(0, DOWN_DESELECT|DOWN_CURRENT, NULL);
else if (CmpArg(1, "%")) /* Selektierte downloaden */
Download(0, DOWN_XFER|DOWN_SELECTED, NULL);
else if (ParseRange(CmdArgV[1]))
Download(0, DOWN_XFER|DOWN_RANGE, NULL); /* Nummernrange downloaden */
else
SysMsg(INVALID_PARAMS);
}
else if (CmdArgC == 3)
{
if (ParseRange(CmdArgV[1]))
{
if (CmpArg(2, "&")) /* Nummer selektieren */
Download(0, DOWN_SELECT|DOWN_RANGE, NULL);
else if (CmpArg(2, "-")) /* Nummer deselektieren */
Download(0, DOWN_DESELECT|DOWN_RANGE, NULL);
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: SCHREIBMODUS *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_SCHREIBMODUS"
VOID Cmd_SCHREIBMODUS(VOID)
{
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
if (CmpArg(1, "+"))
{
KMS_LC->Session.CurrentUser->UserData.Flags |= UF_EXTSEND;
SysMsg(EXTSEND_ENABLED);
}
else if (CmpArg(1, "-"))
{
KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EXTSEND;
SysMsg(EXTSEND_DISABLED);
}
else if (CmpArg(1, "?"))
{
if (KMS_LC->Session.CurrentUser->UserData.Flags & UF_EXTSEND)
SysMsg(EXTSEND_ENABLED);
else
SysMsg(EXTSEND_DISABLED);
}
else
SysMsg(INVALID_PARAMS);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: EXEC *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_EXEC"
VOID Cmd_EXEC(VOID)
{
TEXT outbuff[LEN_PARSEOUT+1];
TEXT numbuff[LEN_NUMBER+1];
if (CmdArgC == 1)
SysMsg(TOO_FEW_PARAMS);
else if (CmdArgC == 2)
{
sprintf(numbuff, "%d", KMS_LC->ID);
PPArg = numbuff;
StdStringParse(CmdArgV[1], outbuff, LEN_PARSEOUT);
PPArg = NULL;
SystemCall(outbuff);
}
else
SysMsg(TOO_MANY_PARAMS);
}
///
/***************************************
* Befehl: PAUSE *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_PAUSE"
VOID Cmd_PAUSE(VOID)
{
if (CmdArgC > 1)
SysMsg(TOO_MANY_PARAMS);
else
ReturnRequest();
}
///
/***************************************
* Befehl: CHAT *
***************************************
* I: --- *
* O: --- *
***************************************/
/// "Cmd_CHAT"
VOID Cmd_CHAT(VOID)
{
if (CmdArgC > 2)
SysMsg(TOO_MANY_PARAMS);
else if (CmdArgC == 2)
ChitChat(CmdArgV[1]);
else
ChitChat(NULL);
}
///